﻿Public Class ctrQuanLy

    Private Sub btnNhanVien_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNhanVien.Click
        frmMain.Panel3.Controls.Clear()
        Dim ctr As ctrNhanVien = New ctrNhanVien()
        frmMain.Panel3.Controls.Add(ctr)
        ctr.Dock = DockStyle.Fill

        'effect
        btnNhanVien.ForeColor = Color.White
        btnNhanVien.BackColor = Color.Blue
        btnBan.ForeColor = Color.Blue
        btnBan.BackColor = Color.White
        btnThucDon.ForeColor = Color.Blue
        btnThucDon.BackColor = Color.White
        btnHoaDon.ForeColor = Color.Blue
        btnHoaDon.BackColor = Color.White

        If frmMain.lbType.Text = "(Nhân viên)" Then
            ctr.btnBC_CV.Enabled = False
            ctr.btnChinhSuaNV.Enabled = False
            ctr.btnPhanCong.Enabled = False
            ctr.btnTiepNhan.Enabled = False
        End If
    End Sub

    Private Sub btnBan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBan.Click
        frmMain.Panel3.Controls.Clear()
        Dim ctr As ctrBan = New ctrBan()
        frmMain.Panel3.Controls.Add(ctr)
        ctr.Dock = DockStyle.Fill

        'effect
        btnNhanVien.ForeColor = Color.Blue
        btnNhanVien.BackColor = Color.White
        btnBan.ForeColor = Color.White
        btnBan.BackColor = Color.Blue
        btnThucDon.ForeColor = Color.Blue
        btnThucDon.BackColor = Color.White
        btnHoaDon.ForeColor = Color.Blue
        btnHoaDon.BackColor = Color.White

        If frmMain.lbType.Text = "(Nhân viên)" Then
            ctr.btnChinhSua.Enabled = False
            ctr.btnDatBan.Enabled = False
        End If
    End Sub

    Private Sub btnThucDon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThucDon.Click
        frmMain.Panel3.Controls.Clear()
        Dim ctr As ctrThucDon = New ctrThucDon()
        frmMain.Panel3.Controls.Add(ctr)
        ctr.Dock = DockStyle.Fill

        'effect      
        btnNhanVien.ForeColor = Color.Blue
        btnNhanVien.BackColor = Color.White
        btnBan.ForeColor = Color.Blue
        btnBan.BackColor = Color.White
        btnThucDon.ForeColor = Color.White
        btnThucDon.BackColor = Color.Blue
        btnHoaDon.ForeColor = Color.Blue
        btnHoaDon.BackColor = Color.White

        If frmMain.lbType.Text = "(Nhân viên)" Then
            ctr.btnChinhSua.Enabled = False
        End If
    End Sub

    Private Sub btnHoaDon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHoaDon.Click
        frmMain.Panel3.Controls.Clear()
        Dim ctr As ctrHoaDon = New ctrHoaDon()
        frmMain.Panel3.Controls.Add(ctr)
        ctr.Dock = DockStyle.Fill

        'effect
        btnHoaDon.ForeColor = Color.White
        btnHoaDon.BackColor = Color.Blue
        btnNhanVien.ForeColor = Color.Blue
        btnNhanVien.BackColor = Color.White
        btnBan.ForeColor = Color.Blue
        btnBan.BackColor = Color.White
        btnThucDon.ForeColor = Color.Blue
        btnThucDon.BackColor = Color.White

        If frmMain.lbType.Text = "(Nhân viên)" Then
            ctr.btnThanhToan.Enabled = False
        End If
    End Sub
End Class
